package ccrClasses.layer2;

import ccrClasses.ICcr;

public class Test implements ICcr {
	
	public static final String OPEN_TAG = "<Test>";

	public static final String CLOSE_TAG = "</Test>";
	
	private DateTime collectionDateTime;
	
	private Description description;
	
	private Source source;
	
	private NormalResult normalResult;
	
	private TestResult testResult;
	
	public Test(){
		super();
	}
	
	public Test(DateTime collectionDateTime, Description description,
			Source source, NormalResult normalResult, TestResult testResult) {
		super();
		this.setCollectionDateTime(collectionDateTime);
		this.setDescription(description);
		this.setSource(source);
		this.setNormalResult(normalResult);
		this.setTestResult(testResult);
	}
	
	public Test(DateTime collectionDateTime, Description description,
			Source source, NormalResult normalResult) {
		super();
		this.setCollectionDateTime(collectionDateTime);
		this.setDescription(description);
		this.setSource(source);
		this.setNormalResult(normalResult);
		
	}
	
	public Test(DateTime collectionDateTime, Description description,
			Source source) {
		super();
		this.setCollectionDateTime(collectionDateTime);
		this.setDescription(description);
		this.setSource(source);
		
	}
	
	public Test(DateTime collectionDateTime, Description description) {
		super();
		this.setCollectionDateTime(collectionDateTime);
		this.setDescription(description);
		
	}
	
	public Test(DateTime collectionDateTime) {
		super();
		this.setCollectionDateTime(collectionDateTime);
	}



	@Override
	public String constructCcrString() {
		String ccrTest = OPEN_TAG;
		if(collectionDateTime != null){
			ccrTest += collectionDateTime.constructCcrString();
		}
		
		if(description != null){
			ccrTest += description.constructCcrString();
		}
		
		if(source != null){
			ccrTest += source.constructCcrString();
		}
				
		if(normalResult != null){
			ccrTest += normalResult.constructCcrString();
		}
		
		if(testResult != null){
			ccrTest += testResult.constructCcrString();
		}
		
		ccrTest += CLOSE_TAG;
		return ccrTest;
	}

	/**
	 * @param collectionDateTime the collectionDateTime to set
	 */
	public void setCollectionDateTime(DateTime collectionDateTime) {
		this.collectionDateTime = collectionDateTime;
	}

	/**
	 * @return the collectionDateTime
	 */
	public DateTime getCollectionDateTime() {
		return collectionDateTime;
	}

	/**
	 * @param description the description to set
	 */
	public void setDescription(Description description) {
		this.description = description;
	}

	/**
	 * @return the description
	 */
	public Description getDescription() {
		return description;
	}

	/**
	 * @param source the source to set
	 */
	public void setSource(Source source) {
		this.source = source;
	}

	/**
	 * @return the source
	 */
	public Source getSource() {
		return source;
	}

	/**
	 * @param normalResult the normalResult to set
	 */
	public void setNormalResult(NormalResult normalResult) {
		this.normalResult = normalResult;
	}

	/**
	 * @return the normalResult
	 */
	public NormalResult getNormalResult() {
		return normalResult;
	}

	/**
	 * @param testResult the testResult to set
	 */
	public void setTestResult(TestResult testResult) {
		this.testResult = testResult;
	}

	/**
	 * @return the testResult
	 */
	public TestResult getTestResult() {
		return testResult;
	}

}
